//
//  Auction_SpecialSaleBottmoV_View_WX.m
//  ZITHER
//
//  Created by weixin on 2019/6/3.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Auction_SpecialSaleBottmoV_View_WX.h"

@implementation Auction_SpecialSaleBottmoV_View_WX

-(void)setState:(SpecialSaleBottmoVState)State{
    _State = State;

    switch (self.State) {
        case SpecialSaleBottmoVSoldOut:
            //已经下架
            
            break;
        case SpecialSaleBottmoVdiscounts:
            //领券
            self.getBtn.hidden = NO;
            self.bargainBtn.hidden = YES;
            self.acceptBtn.hidden = YES;
            break;
        case SpecialSaleBottmoVUnQuotation:
            //未报价
            self.getBtn.hidden = YES;
            self.bargainBtn.hidden = NO;
            self.acceptBtn.hidden = NO;
            break;
        case SpecialSaleBottmoVQuotation:
            //已报价
            
            break;
        default:
            break;
    }

}


- (BaseBtn *)getBtn{
    if (!_getBtn) {
        _getBtn = [BaseBtn initCustomBtnImageAndTitles:@[@"免费领取"] images:@[@""] color:@[[UIColor whiteColor]]];
        _getBtn.backgroundColor = HexColor(0xff6f6f);
        _getBtn.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15];
        [self addSubview:_getBtn];
        
        [_getBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).offset(10);
            make.left.equalTo(self).offset(70);
            make.right.equalTo(self).offset(-70);
            make.height.mas_equalTo(40);
        }];
    }
    return _getBtn;
}

//230 104

- (BaseBtn *)acceptBtn{
    if (!_acceptBtn) {
        _acceptBtn = [BaseBtn initCustomBtnImageAndTitles:@[@"接受特卖价格"] images:@[@""] color:@[[UIColor whiteColor]]];
        _acceptBtn.backgroundColor = HexColor(0xff6f6f);
        _acceptBtn.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15];
        [self addSubview:_acceptBtn];
        
        [_acceptBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self).offset(-kBottomSafeHeight);
            make.left.equalTo(self).offset(15);
//            make.right.equalTo(self).offset(-70);
            make.height.mas_equalTo(40);
            make.width.mas_equalTo(230);
        }];
    }
    return _acceptBtn;
}

- (BaseBtn *)bargainBtn{
    if (!_bargainBtn) {
        _bargainBtn = [BaseBtn initCustomBtnImageAndTitles:@[@"砍价"] images:@[@""] color:@[[UIColor whiteColor]]];
        _bargainBtn.backgroundColor = HexColor(0xff6f6f);
        _bargainBtn.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15];
        [self addSubview:_bargainBtn];
        
        [_bargainBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self).offset(-kBottomSafeHeight);
//            make.left.equalTo(self).offset(70);
            make.right.equalTo(self).offset(-16);
            make.height.mas_equalTo(40);
            make.width.mas_equalTo(110);
        }];
    }
    return _bargainBtn;
}
@end
